package com.wiyun.engine.skeleton;

import java.io.IOException;
import java.io.InputStream;
import java.util.Dictionary;
import java.util.Hashtable;

import android.content.res.AssetManager;

import com.thoughtworks.xstream.XStream;

public class XmlData {
	private static XmlData instance=new XmlData(); 
	public static XmlData GetInstance()
	{
		return instance;
	}
	
	private Dictionary<String, PictureObj> dictPictureObj=new Hashtable<String, PictureObj>();
	
	public void ReadXml(String[] xmlPath, AssetManager manager) throws IOException
	{
		for(int i=0;i<xmlPath.length;i++)
		{
			XStream xStream = new XStream();
			String path = "xml/"+xmlPath[i];
			InputStream inStream = manager.open("test1.xml");
			Object obj = xStream.fromXML(inStream);
			//dictPictureObj.put(xmlPath[i], obj);
		}
	}
	public void ReadXml(InputStream stream, String path)
	{
		XStream xStream = new XStream();
		PictureObj obj = (PictureObj)xStream.fromXML(stream);
		dictPictureObj.put(path, obj);
		
	}
	
	public Dictionary<String, PictureObj> getDictPictureObj()
	{
		return dictPictureObj;
	}
}
